<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="boxDiv">hello div</div>
    <p id="boxP">
      hello p
      <b>jack <i id="boxI">!!</i> </b>
    </p>
    <script>
      console.log(document.body.children[0]); //div
      console.log(document.body.children[1]); //p

      console.log(document.getElementById("boxDiv"));
      console.log(document.getElementById("boxP"));
      console.log(document.getElementById("boxI"));
      console.log("----------------");
      let boxDiv = null;
      console.log(boxDiv);
      console.log(boxP);
      console.log(boxI);
    </script>
  </body>
</html>
